<template>
	<view class="loginContainer">
		<image class="logo" src="../../static/images/login/logintitle.png" mode=""></image>
		<p class="text">欢迎来到E宠商城</p>
		<div class="loginMethods">
			<button class="login wechatLogin" @click="getUserInfo">微信登录</button>
			<button class="login emailLogin">邮箱登录</button>
		</div>
	</view>
</template>

<script>
export default {
	data(){
		return{
			
		}
	},
	methods:{
		getUserInfo(){
			wx.getUserProfile({
			      desc: '用于完善会员资料', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
			      success: (res) => {
			        // console.log(res);//就是用户信息相关的数据
					//保存用户信息到storage里面
					wx.setStorageSync("userinfo_key",res.userInfo)
					//跳转到个人中心
					wx.reLaunch({
						url:"/pages/center/center"
					})
			      }
			    })
		}
	}
};
</script>

<style lang="stylus">
.loginContainer
	width 100%
	height 100%
	background #F8F8F8
	display flex
	align-items center
	flex-direction column
	.logo
		width 400upx
		height 300upx
		margin-top 200upx
	.text
		font-size 26upx
		color #666
	.loginMethods
		width 80%
		margin 150upx auto
		display flex
		justify-content space-around
		.login
			width 240upx
			height 80upx
			background #41A863
			color #FFFFFF
			text-align center
			line-height 80upx
			font-size 26upx
</style>
